<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('Hbase监控')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="online-form">
                <div class="select-list">
                    <ul>
                        <li>
                            环境：<select name="cluster" th:with="type=${@dict.getType('bigdata_env')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                        </select>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" th:action="@{/business/hbase/list}" th:method="post" onclick="search2()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                        </li>
                    </ul>
                </div>

            </form>
        </div>
        <div  class="col-sm-12 search-collapse">
            <br/>
            <div class="col-sm-3">
                <div class="ibox">
                    <div class="ibox-content">
                        <h5 class="m-b-md">活跃RegionServer数量</h5>
                        <h2 class="text-navy" id = "mNumRegionServers">
                        </h2>
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <div class="ibox">
                    <div class="ibox-content">
                        <h5 class="m-b-md">异常RegionServer数量</h5>
                        <h2 class="text-navy" id = "mNumDeadRegionServers">
                        </h2>
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <div class="ibox">
                    <div class="ibox-content">
                        <h5 class="m-b-md">集群平均负载</h5>
                        <h2 class="text-navy" id = "mAverageLoad">
                        </h2>
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <div class="ibox">
                    <div class="ibox-content">
                        <h5 class="m-b-md">RIT数量</h5>
                        <h2 class="text-navy" id = "mRitCount">
                        </h2>
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <div class="ibox">
                    <div class="ibox-content">
                        <h5 class="m-b-md">RIT时间超过阈值的个数</h5>
                        <h2 class="text-navy" id = "mRitCountOverThreshold">
                        </h2>
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <div class="ibox">
                    <div class="ibox-content">
                        <h5 class="m-b-md">RIT最老时间</h5>
                        <h2 class="text-navy" id = "mRitOldestAge">
                        </h2>
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <div class="ibox">
                    <div class="ibox-content">
                        <h5 class="m-b-md">集群负载均衡次数</h5>
                        <h2 class="text-navy" id = "mBalancerCluster_num_ops">
                        </h2>
                    </div>
                </div>
            </div>
        </div>

        <div class="col-sm-12 search-collapse">
            <br/>
            <div class="col-sm-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>Region 副本的 HFile 位于本地 HDFS data node的比例</h5>
                        <div class="ibox-tools">

                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <i class="fa fa-wrench"></i>
                            </a>
                            <ul class="dropdown-menu dropdown-user">
                                <li><a onclick="f(7)">7分钟</a></li>
                                <li><a onclick="f(30)">30分钟</a></li>
                                <li><a onclick="f(60)">60分钟</a></li>
                                <li><a onclick="f(720)">12小时</a></li>
                                <li><a onclick="f(1440)">24小时</a></li>
                            </ul>

                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="echarts" id="rpercentFilesLocalSecondaryRegions"></div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>Region 的 HFile 位于本地 HDFS data node的比例</h5>
                        <div class="ibox-tools">
                            
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <i class="fa fa-wrench"></i>
                            </a>
                            <ul class="dropdown-menu dropdown-user">
                                <li><a onclick="f(7)">7分钟</a></li>
                                <li><a onclick="f(30)">30分钟</a></li>
                                <li><a onclick="f(60)">60分钟</a></li>
                                <li><a onclick="f(720)">12小时</a></li>
                                <li><a onclick="f(1440)">24小时</a></li>
                            </ul>
                            
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="echarts" id="rpercentFilesLocal"></div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>Compaction 队列长度</h5>
                        <div class="ibox-tools">
                            
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <i class="fa fa-wrench"></i>
                            </a>
                            <ul class="dropdown-menu dropdown-user">
                                <li><a onclick="f(7)">7分钟</a></li>
                                <li><a onclick="f(30)">30分钟</a></li>
                                <li><a onclick="f(60)">60分钟</a></li>
                                <li><a onclick="f(720)">12小时</a></li>
                                <li><a onclick="f(1440)">24小时</a></li>
                            </ul>
                            
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="echarts" id="rcompactionQueueLength"></div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>Storefile 大小</h5>
                        <div class="ibox-tools">
                            
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <i class="fa fa-wrench"></i>
                            </a>
                            <ul class="dropdown-menu dropdown-user">
                                <li><a onclick="f(7)">7分钟</a></li>
                                <li><a onclick="f(30)">30分钟</a></li>
                                <li><a onclick="f(60)">60分钟</a></li>
                                <li><a onclick="f(720)">12小时</a></li>
                                <li><a onclick="f(1440)">24小时</a></li>
                            </ul>
                            
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="echarts" id="rstoreFileSize"></div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>Storefile 个数</h5>
                        <div class="ibox-tools">
                            
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <i class="fa fa-wrench"></i>
                            </a>
                            <ul class="dropdown-menu dropdown-user">
                                <li><a onclick="f(7)">7分钟</a></li>
                                <li><a onclick="f(30)">30分钟</a></li>
                                <li><a onclick="f(60)">60分钟</a></li>
                                <li><a onclick="f(720)">12小时</a></li>
                                <li><a onclick="f(1440)">24小时</a></li>
                            </ul>
                            
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="echarts" id="rstoreCount"></div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>Memstore 大小（MB）</h5>
                        <div class="ibox-tools">
                            
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <i class="fa fa-wrench"></i>
                            </a>
                            <ul class="dropdown-menu dropdown-user">
                                <li><a onclick="f(7)">7分钟</a></li>
                                <li><a onclick="f(30)">30分钟</a></li>
                                <li><a onclick="f(60)">60分钟</a></li>
                                <li><a onclick="f(720)">12小时</a></li>
                                <li><a onclick="f(1440)">24小时</a></li>
                            </ul>
                            
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="echarts" id="rmemStoreSize"></div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>慢操作次数/Get 请求时间超过1s的数量</h5>
                        <div class="ibox-tools">
                            
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <i class="fa fa-wrench"></i>
                            </a>
                            <ul class="dropdown-menu dropdown-user">
                                <li><a onclick="f(7)">7分钟</a></li>
                                <li><a onclick="f(30)">30分钟</a></li>
                                <li><a onclick="f(60)">60分钟</a></li>
                                <li><a onclick="f(720)">12小时</a></li>
                                <li><a onclick="f(1440)">24小时</a></li>
                            </ul>
                            
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="echarts" id="rslowGetCount"></div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>Get 请求量</h5>
                        <div class="ibox-tools">
                            
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <i class="fa fa-wrench"></i>
                            </a>
                            <ul class="dropdown-menu dropdown-user">
                                <li><a onclick="f(7)">7分钟</a></li>
                                <li><a onclick="f(30)">30分钟</a></li>
                                <li><a onclick="f(60)">60分钟</a></li>
                                <li><a onclick="f(720)">12小时</a></li>
                                <li><a onclick="f(1440)">24小时</a></li>
                            </ul>
                            
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="echarts" id="rgetNumOps"></div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>Put 请求量</h5>
                        <div class="ibox-tools">
                            
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <i class="fa fa-wrench"></i>
                            </a>
                            <ul class="dropdown-menu dropdown-user">
                                <li><a onclick="f(7)">7分钟</a></li>
                                <li><a onclick="f(30)">30分钟</a></li>
                                <li><a onclick="f(60)">60分钟</a></li>
                                <li><a onclick="f(720)">12小时</a></li>
                                <li><a onclick="f(1440)">24小时</a></li>
                            </ul>
                            
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="echarts" id="rputNumOps"></div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>Region数量</h5>
                        <div class="ibox-tools">
                            
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <i class="fa fa-wrench"></i>
                            </a>
                            <ul class="dropdown-menu dropdown-user">
                                <li><a onclick="f(7)">7分钟</a></li>
                                <li><a onclick="f(30)">30分钟</a></li>
                                <li><a onclick="f(60)">60分钟</a></li>
                                <li><a onclick="f(720)">12小时</a></li>
                                <li><a onclick="f(1440)">24小时</a></li>
                            </ul>
                            
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="echarts" id="rregionCount"></div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>重启集群后的写请求数量</h5>
                        <div class="ibox-tools">
                            
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <i class="fa fa-wrench"></i>
                            </a>
                            <ul class="dropdown-menu dropdown-user">
                                <li><a onclick="f(7)">7分钟</a></li>
                                <li><a onclick="f(30)">30分钟</a></li>
                                <li><a onclick="f(60)">60分钟</a></li>
                                <li><a onclick="f(720)">12小时</a></li>
                                <li><a onclick="f(1440)">24小时</a></li>
                            </ul>
                            
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="echarts" id="rwriteRequestCount"></div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>重启集群后的读请求数量</h5>
                        <div class="ibox-tools">
                            
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <i class="fa fa-wrench"></i>
                            </a>
                            <ul class="dropdown-menu dropdown-user">
                                <li><a onclick="f(7)">7分钟</a></li>
                                <li><a onclick="f(30)">30分钟</a></li>
                                <li><a onclick="f(60)">60分钟</a></li>
                                <li><a onclick="f(720)">12小时</a></li>
                                <li><a onclick="f(1440)">24小时</a></li>
                            </ul>
                            
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="echarts" id="rreadRequestCount"></div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>进程 commit 的非堆内存大小，单位M</h5>
                        <div class="ibox-tools">
                            
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <i class="fa fa-wrench"></i>
                            </a>
                            <ul class="dropdown-menu dropdown-user">
                                <li><a onclick="f(7)">7分钟</a></li>
                                <li><a onclick="f(30)">30分钟</a></li>
                                <li><a onclick="f(60)">60分钟</a></li>
                                <li><a onclick="f(720)">12小时</a></li>
                                <li><a onclick="f(1440)">24小时</a></li>
                            </ul>
                            
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="echarts" id="rmemNonHeapCommittedM"></div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>进程使用的堆内存大小，单位M</h5>
                        <div class="ibox-tools">
                            
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <i class="fa fa-wrench"></i>
                            </a>
                            <ul class="dropdown-menu dropdown-user">
                                <li><a onclick="f(7)">7分钟</a></li>
                                <li><a onclick="f(30)">30分钟</a></li>
                                <li><a onclick="f(60)">60分钟</a></li>
                                <li><a onclick="f(720)">12小时</a></li>
                                <li><a onclick="f(1440)">24小时</a></li>
                            </ul>
                            
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="echarts" id="rmemHeapUsedM"></div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>进程使用的非堆内存大小，单位M</h5>
                        <div class="ibox-tools">
                            
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <i class="fa fa-wrench"></i>
                            </a>
                            <ul class="dropdown-menu dropdown-user">
                                <li><a onclick="f(7)">7分钟</a></li>
                                <li><a onclick="f(30)">30分钟</a></li>
                                <li><a onclick="f(60)">60分钟</a></li>
                                <li><a onclick="f(720)">12小时</a></li>
                                <li><a onclick="f(1440)">24小时</a></li>
                            </ul>
                            
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="echarts" id="rmemNonHeapUsedM"></div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>进程最大的堆内存大小，单位M</h5>
                        <div class="ibox-tools">
                            
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <i class="fa fa-wrench"></i>
                            </a>
                            <ul class="dropdown-menu dropdown-user">
                                <li><a onclick="f(7)">7分钟</a></li>
                                <li><a onclick="f(30)">30分钟</a></li>
                                <li><a onclick="f(60)">60分钟</a></li>
                                <li><a onclick="f(720)">12小时</a></li>
                                <li><a onclick="f(1440)">24小时</a></li>
                            </ul>
                            
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="echarts" id="rmemHeapMaxM"></div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>进程最大内存大小，单位M</h5>
                        <div class="ibox-tools">
                            
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <i class="fa fa-wrench"></i>
                            </a>
                            <ul class="dropdown-menu dropdown-user">
                                <li><a onclick="f(7)">7分钟</a></li>
                                <li><a onclick="f(30)">30分钟</a></li>
                                <li><a onclick="f(60)">60分钟</a></li>
                                <li><a onclick="f(720)">12小时</a></li>
                                <li><a onclick="f(1440)">24小时</a></li>
                            </ul>
                            
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="echarts" id="rmemMaxM"></div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>NotServingRegionException 异常数量</h5>
                        <div class="ibox-tools">
                            
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <i class="fa fa-wrench"></i>
                            </a>
                            <ul class="dropdown-menu dropdown-user">
                                <li><a onclick="f(7)">7分钟</a></li>
                                <li><a onclick="f(30)">30分钟</a></li>
                                <li><a onclick="f(60)">60分钟</a></li>
                                <li><a onclick="f(720)">12小时</a></li>
                                <li><a onclick="f(1440)">24小时</a></li>
                            </ul>
                            
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="echarts" id="rnotServingRegionExceptionNum"></div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>RegionTooBusyException 异常数量</h5>
                        <div class="ibox-tools">
                            
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <i class="fa fa-wrench"></i>
                            </a>
                            <ul class="dropdown-menu dropdown-user">
                                <li><a onclick="f(7)">7分钟</a></li>
                                <li><a onclick="f(30)">30分钟</a></li>
                                <li><a onclick="f(60)">60分钟</a></li>
                                <li><a onclick="f(720)">12小时</a></li>
                                <li><a onclick="f(1440)">24小时</a></li>
                            </ul>
                            
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="echarts" id="rregionTooBusyException"></div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>集群请求数量</h5>
                        <div class="ibox-tools">
                            
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <i class="fa fa-wrench"></i>
                            </a>
                            <ul class="dropdown-menu dropdown-user">
                                <li><a onclick="f(7)">7分钟</a></li>
                                <li><a onclick="f(30)">30分钟</a></li>
                                <li><a onclick="f(60)">60分钟</a></li>
                                <li><a onclick="f(720)">12小时</a></li>
                                <li><a onclick="f(1440)">24小时</a></li>
                            </ul>
                            
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="echarts" id="mclusterRequests"></div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>Young GC 数量</h5>
                        <div class="ibox-tools">
                            
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <i class="fa fa-wrench"></i>
                            </a>
                            <ul class="dropdown-menu dropdown-user">
                                <li><a onclick="f(7)">7分钟</a></li>
                                <li><a onclick="f(30)">30分钟</a></li>
                                <li><a onclick="f(60)">60分钟</a></li>
                                <li><a onclick="f(720)">12小时</a></li>
                                <li><a onclick="f(1440)">24小时</a></li>
                            </ul>
                            
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="echarts" id="ryoungGcCount"></div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>Young GC 时间</h5>
                        <div class="ibox-tools">
                            
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <i class="fa fa-wrench"></i>
                            </a>
                            <ul class="dropdown-menu dropdown-user">
                                <li><a onclick="f(7)">7分钟</a></li>
                                <li><a onclick="f(30)">30分钟</a></li>
                                <li><a onclick="f(60)">60分钟</a></li>
                                <li><a onclick="f(720)">12小时</a></li>
                                <li><a onclick="f(1440)">24小时</a></li>
                            </ul>
                            
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="echarts" id="ryoungGcTime"></div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>Full GC 数量</h5>
                        <div class="ibox-tools">
                            
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <i class="fa fa-wrench"></i>
                            </a>
                            <ul class="dropdown-menu dropdown-user">
                                <li><a onclick="f(7)">7分钟</a></li>
                                <li><a onclick="f(30)">30分钟</a></li>
                                <li><a onclick="f(60)">60分钟</a></li>
                                <li><a onclick="f(720)">12小时</a></li>
                                <li><a onclick="f(1440)">24小时</a></li>
                            </ul>
                            
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="echarts" id="rfullGcCount"></div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>Full GC 时间</h5>
                    <div class="ibox-tools">
                        
                        <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                            <i class="fa fa-wrench"></i>
                        </a>
                        <ul class="dropdown-menu dropdown-user">
                            <li><a onclick="f(7)">7分钟</a></li>
                            <li><a onclick="f(30)">30分钟</a></li>
                            <li><a onclick="f(60)">60分钟</a></li>
                            <li><a onclick="f(720)">12小时</a></li>
                            <li><a onclick="f(1440)">24小时</a></li>
                        </ul>
                        
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="echarts" id="rfullGcTime"></div>
                </div>
            </div>
        </div>
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table class="echarts" id="bootstrap-table"></table>
        </div>
    </div>

</div>

<th:block th:include="include :: footer" />
<th:block th:include="include :: echarts-js" />
<script th:inline="javascript">
    var prefix = ctx + "business/hbase";

    $(function() {
        var options = {
            uniqueId: "hkey",
            url: prefix + "/list",
            sortName: "hkey",
            sortOrder: "desc",
            showExport: true,
            escape: true,
            pageSize: 500,
            columns: [
                {
                    field: 'hkey',
                    title: '监控指标',
                    sortable: true
                },{
                    field: 'node',
                    title: '节点',
                    sortable: true
                },
                {
                    field: 'hvalue',
                    title: '值'
                },
                {
                    field: 'updateTime',
                    title: '更新时间',
                    sortable: true
                }]
        };
        $.table.init(options);
    });

    $(function () {
        searchBasicInfo()
    })
    function search2(){
        $.table.search()
        searchBasicInfo()
    };

    function searchBasicInfo() {
        //获取需要查看的环境
        var env = $('[name="cluster"]').val()
        var url = "/business/hbase/getBasicInfo";
        var data = { "cluster": env }
        //发送post请求，result返回请求结果
        getVersion(url, "post", "json", data, function (result) {
            var nullValue = "-"
            $("#mNumRegionServers").text($.common.isEmpty(result.data.mNumRegionServers) ? nullValue : result.data.mNumRegionServers);
            $("#mNumDeadRegionServers").text($.common.isEmpty(result.data.mNumDeadRegionServers) ? nullValue : result.data.mNumDeadRegionServers);
            $("#mAverageLoad").text($.common.isEmpty(result.data.mAverageLoad) ? nullValue : result.data.mAverageLoad);
            $("#mRitCount").text($.common.isEmpty(result.data.mRitCount) ? nullValue : result.data.mRitCount);
            $("#mRitCountOverThreshold").text($.common.isEmpty(result.data.mRitCountOverThreshold) ? nullValue : result.data.mRitCountOverThreshold);
            $("#mRitOldestAge").text($.common.isEmpty(result.data.mRitOldestAge) ? nullValue : result.data.mRitOldestAge);
            $("#mBalancerCluster_num_ops").text($.common.isEmpty(result.data.mBalancerCluster_num_ops) ? nullValue : result.data.mBalancerCluster_num_ops);
            //刷新折线图
            f(defaultTime)

        })
    }

    function getVersion(url, type, dataType, data, callback){
        var config = {
            url: url,
            type: type,
            dataType: dataType,
            data: data,
            success: function(result) {
                if (typeof callback == "function") {
                    callback(result);
                }
            }
        };
        $.ajax(config)
    };


    //默认查询时间
    var defaultTime = "7"
    $(function () {
        //初始化刷新折线图
        f(defaultTime)
    });

    //刷新折线图
    function f(time) {
        //获取需要查看的环境
        var env = $('[name="cluster"]').val()
        var url = "/business/hbaseLine/getBasicInfo";
        var data = { "cluster": env , "time": time}
        getVersion(url, "post", "json", data, function (result) {
            setZXT("rpercentFilesLocalSecondaryRegions",result)
            setZXT("rpercentFilesLocal",result)
            setZXT("rcompactionQueueLength",result)
            setZXT("rstoreFileSize",result)
            setZXT("rstoreCount",result)
            setZXT("rmemStoreSize",result)
            setZXT("rslowGetCount",result)
            setZXT("rgetNumOps",result)
            setZXT("rputNumOps",result)
            setZXT("rregionCount",result)
            setZXT("rwriteRequestCount",result)
            setZXT("rreadRequestCount",result)
            setZXT("rmemNonHeapCommittedM",result)
            setZXT("rmemHeapUsedM",result)
            setZXT("rmemNonHeapUsedM",result)
            setZXT("rmemHeapMaxM",result)
            setZXT("rmemMaxM",result)
            setZXT("rnotServingRegionExceptionNum",result)
            setZXT("rregionTooBusyException",result)
            setZXT("mclusterRequests",result)
            setZXT("rfullGcCount",result)
            setZXT("rfullGcTime",result)
            setZXT("ryoungGcCount",result)
            setZXT("ryoungGcTime",result)

        })
    }
    function setZXT(id,result){
        var lineChart = echarts.init(document.getElementById(id));
        lineChart.setOption({
            tooltip : {
                trigger: 'axis'
            },
            legend: {
                //https://blog.csdn.net/chen__cheng/article/details/118388833
                data: setDesc(result.data,id),
                orient: 'horizontal',
                x:'center',
                y:'top'
            },
            grid:{
                x:40,
                x2:40,
                y2:24
            },
            xAxis : [
                {
                    type : 'category',
                    boundaryGap : false,
                    data : setX(result.data,id)
                }
            ],
            yAxis : [
                {
                    type : 'value',
                    axisLabel : {
                        formatter: '{value}'
                    }
                }
            ],
            series: setService(result.data,id)
        });
        $(window).resize(lineChart.resize);
    }
    //设置横坐标
    function setX(data,dataType) {
        var datum = data[dataType];
        var result = []

        for(var json in datum){
            if(json == "time"){
                return datum[json]
                // var datumElement = datum[json];
                // for (var i = 0; i < datumElement.length; i++) {
                //     var jsonElement = datumElement[i];
                //     result.push(jsonElement.substr(11))
                // }
            }
        }
        // return result

    }
    //设置说明
    function setDesc(data,dataType) {
        var desc = []
        var datum = data[dataType];
        for(var json in datum){
            if(json != "time"){
                desc.push(json)
            }
        }
        return desc
    }

    function setService(data,dataType) {
        var series = []

        var datum = data[dataType];
        // if(datum==undefined){
        //     var xyData = [0];
        //     var item = {
        //         type: 'line',
        //         data: xyData
        //     }
        //     series.push(item)
        //     console.log("112233")
        //     return series
        // }
        for(var json in datum){
            if(json == "time"){

            }else{
                var xyData = [];
                var datumElement = datum[json];
                for (var i = 0; i < datumElement.length; i++) {
                    var jsonElement = datumElement[i];
                    xyData.push(jsonElement)
                }
                var item = {
                    name: json,
                    type: 'line',
                    data: xyData
                }
                series.push(item)
            }
        }
        return series

    }

</script>

</body>
</html>